
// ================ 闭包函数 =================
fn call_closure<F>(f:F)
where F: Fn(i32)->i32
{
    println!("closure call 1 -> {}", f(1))
}

#[test]
fn test_closure(){
    call_closure(|x|x+1+2+3);
}


// ================ 普通函数 =================
fn call_function(f: fn(i32)->i32) {
    println!("function call 1 -> {}", f(1))
}

#[test]
fn test_function(){
    fn f(x:i32)->i32 {
        return x + 100
    }
    call_function(f);
}